<include file="Public:header"/>

<div class="table-tit">
    销售编码列表
    <select class="pull-right" onchange="getselect(this.value);">
        <option value="">请选择</option>
        <volist name="sale" id="v">
            <option value="{$v.sat_para}" <if condition="$v['sat_para'] eq $cds">selected</if>>{$v.sat_name}</option>
        </volist>
    </select>
</div>
<table class="table table-bgfont">
    <tr>
        <th>ID</th>
        <th>销售码</th>
        <th>推广类型</th>
        <th>开始日期</th>
        <th>日序号</th>
        <th>截止日期</th>
        <th>限制码</th>
        <th>当前状态</th>
        <th>管理</th>
    </tr>
    
    <volist name="data.data" id="v">
        <tr>
            <td>{$v.dis_id}</td>
            <td>{$v.dis_isbn}</td>
            <td>{$v.dis_custype}-{$v.dis_custype|getDisName=$v['dis_custype'],###}</td>
            <td>{$v.dis_timecode}</td>
            <td>{$v.dis_sn}</td>
            <td>{$v.dis_endtimecode}</td>
            <td>
        <if condition="$v.dis_limitcode eq 1">Y<else/>N</if>
            </td>
            <td>
                <if condition="$v.dis_status eq 1">
                    <button type="button" class="btn btn-success btn-xs">使用中</button>
                <elseif condition="$v.dis_status eq 8"/>
                    <button type="button" class="btn btn-warning btn-xs">审核中</button>
                <else/>
                <button type="button" class="btn btn-danger btn-xs">暂停中</button>
                </if>
            </td>
            <td>
                <a href="{:U('Dash/salecodeover','cod='.$v['dis_id'])}">
                <button type="button" class="btn btn-info btn-xs">浏览</button>
                </a>
                <a href="{:U('Dash/salecodeedit','cod='.$v['dis_id'])}">
                <button type="button" class="btn btn-xs btn-primary">编辑</button>
                </a>
                <a href="{:U('Curd/cancel')}">
                <button type="button" class="btn btn-xs btn-danger">删除</button>
                </a>
            </td>
        </tr>
    </volist>

    <tr>
        <td colspan="10">{$data.page}</td>
    </tr>


</table>
<script>
    function getselect(val){
        if(val.length!=0){
            window.location="__APP__/Analysis/Dash/salecode/cds/"+val+".html";
        }else{
            window.location="__APP__/Analysis/Dash/salecode.html";
        }
    }
</script>
<include file="Public:footer"/>